﻿using BLL;
using DAL;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Model;

namespace _11._4WebApI.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class RoomHaoController : ControllerBase
    {
        public RoomHaoController (RoomHaoBLL roomHaoBLL)
        {
            RoomHaoBLL = roomHaoBLL;
        }
        public RoomHaoBLL RoomHaoBLL { get; }

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="roomType"></param>
        /// <returns></returns>
        /// 
        [HttpPost]
        public int Add(RoomHao roomHao)
        {
            try
            {
                return RoomHaoBLL.Add(roomHao);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 显示
        /// </summary>
        /// <returns></returns>
        /// 

        [HttpGet]
        public List<RoomHao> GetShow()
        {
            try
            {
                return RoomHaoBLL.GetShow();
            }
            catch (Exception)
            {

                throw;
            }
        }
    }
}
